CREATE external TABLE spmi_dwd.dwd_spmi_temporary_fee_bill_base_dt
(
    id                        bigint COMMENT '主键id',
    waybill_no                string COMMENT '运单号',
    waybill_time              timestamp COMMENT '运单录入时间',
    waybill_date              timestamp COMMENT '运单录入日期',
    send_network_id           bigint COMMENT '寄件网点id',
    send_network_code         string COMMENT '寄件网点编码',
    send_network_name         string COMMENT '寄件网点名称',
    financial_center_id       bigint COMMENT '寄件财务中心id',
    financial_center_code     string COMMENT '寄件财务中心编码',
    financial_center_name     string COMMENT '寄件财务中心名称',
    sender_province_id        bigint COMMENT '寄件省份id',
    sender_province_name      string COMMENT '寄件省份id',
    receiver_province_id      bigint COMMENT '收件省份id',
    receiver_province_name    string COMMENT '收件省份名称',
    piece_network_id          bigint COMMENT '派件费网点id',
    piece_network_code        string COMMENT '派件网点编码',
    piece_network_name        string COMMENT '派件网点名称',
    product_type_id           bigint COMMENT '产品类型id',
    product_type_code         string COMMENT '产品类型编码',
    product_type_name         string COMMENT '产品类型名称',
    destination_province_id   bigint COMMENT '目的省份id',
    destination_province_code string COMMENT '目的省份编码',
    destination_province_name string COMMENT '目的省份名称',
    destination_city_id       bigint COMMENT '目的地id',
    destination_city_code     string COMMENT '目的地编码',
    destination_city_name     string COMMENT '目的地名称',
    package_charge_weight     decimal(18, 2) COMMENT '计费重量',
    opt_fee                   decimal(18, 2) COMMENT '操作费',
    tof_fee                   decimal(18, 2) COMMENT '中转费',
    ele_face_fee              decimal(18, 2) COMMENT '电子面单费',
    base_piece_fee            decimal(18, 2) COMMENT '基础派费',
    create_by_name            string COMMENT '创建人名称',
    create_time               timestamp COMMENT '创建时间',
    create_by                 bigint COMMENT '创建人ID',
    piece_fee                 decimal(18, 2) COMMENT '应收续重派费'
)
    COMMENT '临时四费清洗表'
    PARTITIONED BY (dt string COMMENT '运单创建日期input_time (yyyy-MM-dd)')
    ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
        WITH SERDEPROPERTIES (
        'serialization.format' = '1'
        )
    STORED AS
        INPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
        OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
    LOCATION '/dw/hive/spmi_dwd.db/external/dwd_spmi_temporary_fee_bill_base_dt'
;